import { notifications, waitTimeOut } from '../../common.js';
export async function autoInputAccount({ companyInfo }) {
  companyInfo = companyInfo || {};
  if (!companyInfo.nationalTaxPass) {
    notifications('没有从系统获取到密码,请自行填写');
  }
  await waitTimeOut(2000);
  if (/\/index\/index.html/g.test(window.location.pathname)) {
    $('.mini-tools-close').click();
  }
  $('.login').click();
  await waitTimeOut(1500);
  if ($('#nsrsbh0').length) {
    $('#nsrsbh0').val(
      companyInfo.nationalTaxAccount || companyInfo.nationalTaxId
    );
    // $('#username0').val(
    //   companyInfo.nationalTaxAccount || companyInfo.nationalTaxId
    // );
    $('#passWord0').val(companyInfo.nationalTaxPass);
    $('#nsrsbh0').focus();
  }
}
